$(document).ready(function(){
    $('#agreementSub').on('click', function(){
        $('#postForm').ajaxSubmit({
            url: 'http://127.0.0.1:8080/wineapi/login',
            type: 'get',
            dataType: 'json',
            data: $('#postForm').serialize(),
            success: function (data) {
            if (data.code == "ok") {
                window.location.href="index.html"
            } else {
                alert('登录失败');
            }
            },
            error: function (err) {
            console.log(err)
            },
            clearForm: false, //禁止清除表单
            resetForm: false //禁止重置表单
        })
    })
})